package sk.stuba.fiit.ltasys.web.mvc.model.service.impl;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import sk.stuba.fiit.ltasys.web.mvc.model.dao.UserDao;
import sk.stuba.fiit.ltasys.web.mvc.model.entity.UserEntity;
import sk.stuba.fiit.ltasys.web.mvc.model.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	@Autowired()
	private UserDao userDao;
	
	public Collection<UserEntity> findUsers() {
		return userDao.findUsers();
	}

	public void delete(UserEntity userEntity) {
		userDao.delete(userEntity);	
	}
	
	public void save(UserEntity userEntity){
		userDao.save(userEntity);
	}
	
	public UserEntity findUserById(String id) {
		return userDao.findUserById(id);
	}

	public void deleteByUserName(String name) {
		userDao.deleteUserByName(name);
		
	}

	public UserEntity findUserByUserName(String username) {
		return userDao.findUserByUserName(username);
	}
}
